<cfparam default="none" name="url.api" />
<cfparam default="-1" name="url.StepID" />


<!---Need to call BASE functions--->
<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset term = CreateObject("component", "#session.rootDir#.cfc.Termination") />

<cfif isdefined("FORM.TermReqID")>
    <cfset LOCALS.TermReqID = FORM.TermReqID>     
<cfelseif isdefined("Session.TermReqID")>
    <cfset LOCALS.TermReqID = Session.TermReqID>     
<cfelse>
    <cfset LOCALS.TermReqID = 0>     
</cfif>

<cfif isdefined("FORM.Manual")>
    <cfset LOCALS.Manual = FORM.Manual>
<cfelse>
    <cfset LOCALS.Manual = 0>     
</cfif>


<cfif url.api eq "ad" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfsetting enablecfoutputonly="true">
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />
            <cfoutput>#SerializeJSON(Termination.ADDisable(), true)#</cfoutput>
            
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "home_folder" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfsetting enablecfoutputonly="true">
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />
            <cfoutput>#SerializeJSON(Termination.HomeFolderArchive(), true)#</cfoutput>
            
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "hr" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfsetting enablecfoutputonly="true">
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />
            <cfoutput>#SerializeJSON(Termination.HRDisable(), true)#</cfoutput>
           
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "time_keeper" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfsetting enablecfoutputonly="true">
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />
            <cfoutput>#SerializeJSON(Termination.TimeKeeperDisable(), true)#</cfoutput>
            
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "export_mail" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfsetting enablecfoutputonly="true">
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />
            <cfoutput>#SerializeJSON(Termination.EmailExport(), true)#</cfoutput>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "user_account" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfsetting enablecfoutputonly="true">
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />  
            <cfoutput>#SerializeJSON(Termination.UserAccountDisable(), true)#</cfoutput>
            
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "rosetta" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
        
            <cfsetting enablecfoutputonly="true">
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />
            <cfoutput>#SerializeJSON(Termination.RosettaDisable(), true)#</cfoutput>
            
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "completion" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
        
            <cfsetting enablecfoutputonly="true">            
            <cfset Termination = term.init(LOCALS.TermReqID, LOCALS.Manual) />
            <cfoutput>#SerializeJSON(Termination.TerminationCompletion(), true)#</cfoutput>
            
        </cfcase>    
    </cfswitch>
</cfif>